import request from '@/utils/request'

/**
 * 获取权限点
 * @returns
 */
export function getAllPermissionAPI() {
  return request({
    url: '/sys/permission'
  })
}

/**
 * 添加权限
 * @param {*} data
 * @returns
 */
export function addPermissionAPI(data) {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}

/**
 * 根据id获取权限信息
 * @param {*} id
 * @returns
 */
export function getThePermissionByIdAPI(id) {
  return request({
    url: '/sys/permission/' + id
  })
}

/**
 * 根据id更新权限
 * @param {*} data
 * @returns
 */
export function updateThePermissionByIdAPI(data) {
  return request({
    url: '/sys/permission/' + data.id,
    method: 'PUT',
    data
  })
}

/**
 * 根据id删除权限
 * @param {*} data
 * @returns
 */
export function deleteThePermissionByIdAPI(id) {
  return request({
    url: '/sys/permission/' + id,
    method: 'DELETE'
  })
}

